<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>入党考察</title>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8 ? MYOA_CHARSET : htmlspecialchars($HTML_PAGE_CHARSET))?>" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="/lib/layui/layui/css/layui.css?20190817.1">
    <link rel="stylesheet" href="/lib/layui/layui/css/common.css">
    <link rel="stylesheet" href="/lib/layui/layui/css/eleTree.css">
    <script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
    <script src="/lib/layui/layui/layui.js"></script>
    <script src="/lib/jquery.form.min.js"></script>
    <script src="/lib/layui/layui/js/baseCode/base.js?v=2019080918:09" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="/lib/layui/layui/global.js"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <style>
        /*table{*/
        /*    width: 65%;*/
        /*    margin: 0 auto;*/
        /*    margin-bottom: 20px;*/
        /*}*/
        td{
            /*border: 1px solid #999;*/
            padding: 6px 0;
            /*text-align: center;*/
            height: 40px;
        }
        .fromTr>.fromTd1{
            width: 10%;
        }
        .fromTr>.fromTd2{
            width: 30%;
        }
        .fromTd2{
            padding: 0;
        }
        .fromTrinp{
            width: 94%;
            height: 77%;
            border: none;
            padding: 0 10px;
        }
        input,textarea{
            border: none;
            padding-left: 10px;
        }
        input[name="file"]{
            width: 30%;
        }
        .layui-input, .layui-select, .layui-textarea {
            height: 35px;
        }
        .font_style{
            font-family: Microsoft yahei,Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif;
        }
        table{
            border-collapse:separate!important;
        }
        .layui-form-radio {
            line-height: 20px;
            padding-right: 10px;
            cursor: pointer;
            font-size: 0;
        }
        .layui-btn {
            height: 35px;
            /*background-color: #3691DA;*/
            margin-top: -32px;
        }
        .layui-disabled, .layui-disabled:hover {
            color: #708090!important;
        }
        .mindReport{
            /*width: 120px;*/
            display:inline-block;
            border-radius:5px;
            background-color: #dcdcdc;
            /*height: 40px;*/
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            width: 230px;
            line-height: 40px;
        }
        .mindTime{
            /*width: 120px;*/
            margin-left: 5px;
            display:inline-block;
            border-radius:5px;
            background-color: #dcdcdc;
            /*height: 40px;*/
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            width: 200px;
            line-height: 40px;
        }
    </style>
</head>
<body class="bodycolor font_style">
<table border="0" width="90%" cellspacing="0" cellpadding="3" class="small">
    <tr>
        <td class="Big" style="padding: 19px 0;"><img align="absMiddle" src="/img/commonTheme/${sessionScope.InterfaceModel}/infofind11.png" style="margin-left: 35px;margin-bottom: 2px;"><span class="big3" style="font-family: 微软雅黑;font-size: 22px;margin-left: 10px;">入党考察</span></td>
    </tr>
</table>
<hr style="background-color:#9E9E9E;height: 1px;width:100%;border: none; margin-top: 0px;"/>
<div class="content">
    <form class="layui-form" action="" lay-filter="example">
        <table class="layui-table"  style="margin: 0 auto;margin-top: 20px;width: 82%;">
            <tbody>
            <tr class="fromTr" style="height: 50px;">
                <td colspan="4" style="font-size: 18px; background-color: #009688; text-align: center; color: white">入党考察</td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd1">姓名</td>
                <td class="fromTd2"><input class="fromTrinp layui-disabled"  readonly name="username" type="text"></td>
                <td class="fromTd1">性别</td>
                <td class="fromTd2 ">
                    <%--                    <input type="radio" disabled="disabled" name="sex" value="0" title="男">--%>
                    <%--                    <input type="radio" disabled="disabled" name="sex" value="1" title="女">--%>
                    <input class="fromTrinp layui-disabled" name="sex" type="text">
                </td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd1">出生日期</td>
                <td class="fromTd2"><input class="fromTrinp layui-disabled"  name="nativity" type="text"></td>
                <td class="fromTd1">发展阶段</td>
                <td class="fromTd2">
                    <select class="fromTrinp" disabled="disabled" name="development"  type="text">
                        <option value="0">申请阶段</option>
                        <option value="1">申请阶段</option>
                        <option value="2">入党积极分子</option>
                        <option value="3" >发展对象</option>
                        <option value="4" >预备党员未接收</option>
                        <option value="5">已接收预备党员</option>
                        <option value="6">党员</option>
                    </select>
                </td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd1">民族</td>
                <td class="fromTd2"><input class="fromTrinp layui-disabled" name="minority" type="text"></td>
                <td class="fromTd1">职务</td>
                <td class="fromTd2"><input class="fromTrinp layui-disabled" name="functionar" type="text"></td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd1">单位（部门）</td>
                <td class="fromTd2"><input class="fromTrinp layui-disabled" name="unit" type="text"></td>
                <td class="fromTd1">所属党支部</td>
                <td class="fromTd2"><input class="fromTrinp layui-disabled" name="pertain" type="text"></td>
            </tr>
            <tr class="fromTrme" id="tr1">
                <td colspan="4" style="font-size: 18px; color: #0c8587">积极分子阶段思想汇报<a id="add" style="margin-top:0;margin-left:20px;padding: 0 10px;height: 30px;line-height: 30px; display: none" data-type="0" class="layui-btn layui-btn-xs" lay-event="add">添加</a></td>
            </tr>
            <tr class="fromTrme2" id="tr2">
                <td colspan="4" style="font-size: 18px; color: #0c8587">发展对象阶段思想汇报<a id="add1" style="margin-top:0;margin-left:20px;padding: 0 10px;height: 30px;line-height: 30px; display: none" data-type="0" class="layui-btn layui-btn-xs" lay-event="add">添加</a></td>
            </tr>
            <tr class="fromTrme3" id="tr3">
                <td colspan="4" style="font-size: 18px; color: #0c8587">预备党员阶段思想汇报<a id="add2" style="margin-top:0;margin-left:20px;padding: 0 10px;height: 30px;line-height: 30px; display: none" data-type="0" class="layui-btn layui-btn-xs" lay-event="add2">添加</a></td>
            </tr>
            <%--<tr class="fromTrme3" >--%>
                <%--<td class="fromTdme3" rowspan="1"></td>--%>
            <%--</tr>--%>
            </tbody>
        </table>
    </form>
</div>
</body>
</html>
<script>
    var userId;
    layui.use(['upload','form','table','laydate'], function() {
        var upload = layui.upload
            ,form = layui.form
            ,table = layui.table
            ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        $.ajax({
            url: '/Meetequipment/getuser',
            type: 'get',
            dataType: 'json',
            success: function (res) {
                var userId = res.object.userId;
                $.ajax({
                    type:'get',
                    url:'/partyMember/partyInfo',
                    data:{
                        userId:userId
                    },
                    dataType: 'json',
                    success: function (res) {
                        //console.log(res.object)
                        var data=res.object
                        var userId = data.userId;
                        var phase = data.developPhase;
                        if(phase == "2"||phase=="3"||phase=="4"){
                            $("#add").css('display','');
                        }
                        if(phase == "5"){
                            $("#add2").css('display','');
                        }
                        var sex = "";
                        if (data.sex == 0) {
                            sex = '男';
                        } else {
                            sex = '女';
                        }
                        //input框赋值
                        form.val('example', {
                            "username": data.userName
                            ,"development": data.developPhase //发展阶段
                            ,"sex": sex
                            ,"nativity": data.birthday  //出生日期
                            ,"minority": data.familyName //民族
                            ,"functionar": data.postName//职务
                            ,"unit": data.deptName //单位（部门）
                            ,"pertain": data.parentPedtName //所属党支部
                        });
                        if(data.userName == ''){
                            layer.alert('您还未申请入党', {
                                icon: 5,
                                title: "提示"
                            });
                        }
                        var id1 = data.attachmentIdReport;
                        var name1 = data.attachmentNameReport;
                        var time1 = data.reportTime;
                        var id2 = data.attachmentIdDevelopsReport;
                        var name2 = data.attachmentNameDevelopsReport;
                        var time2 = data.developsReportTime;
                        var id3 = data.attachmentIdThoughtReport;
                        var name3 = data.attachmentNameThoughtReport;
                        var time3 = data.thoughtReportTime;
                        if(id1 != undefined && id1 != ""){
                            if(id1.substring(id1.length-1,id1.length)==","){
                                id1 = id1.substring(0,id1.length-1);
                            }
                            id1 = id1.split(",");
                            name1 = name1.split(",")
                            time1 = time1.split(",")
                            var str = "";
                            for(var i = 0 ; i < id1.length ; i++){
                                num = i;
                                var na = name1[i].substring(0,name1[i].length-1);
                                var id = id1[i].substring(0,id1[i].length-1);
                                var ti = time1[i];
                                var aid = "\'"+urlTOattid(id1[i].substring(0,id1[i].length-1))+"\'";
                                if(i==0){
                                    str =  ' <tr class="fromTrme">\n' +
                                        '<td class="fromTdme1">入党积极分子思想汇报进度</td>'+
                                        '                <td class="fromTdme2"  colspan="3">\n' +
                                        '                    <span class="mindReport">'+ na +'</span><span class="mindTime">'+ ti +'</span>\n' +
                                        '                    <button type="button" class="layui-btn" onclick="dj($(this))" style="cursor:pointer;" attrurl="'+ id +'">查看</button>\n' +
                                        '                    <button type="button" class="layui-btn" onclick="downFile('+aid+')" style="cursor:pointer; margin-left: 10px;" >下载</button>\n' +
                                        '                    <button type="button" class="layui-btn" id="del" onclick="delFn('+i+')" style="cursor:pointer; margin-left: 10px;"  nu = "'+ i +'">删除</button>\n' +
                                        '                </td>\n' +
                                        '            </tr>'
                                }else{
                                    str += ' <tr class="fromTrme">\n' +
                                        '<td style="display: none"></td>'+
                                        '                <td class="fromTdme2"  colspan="3">\n' +
                                        '                    <span class="mindReport">'+ na +'</span><span class="mindTime">'+ ti +'</span>' +
                                        '                    <button type="button" class="layui-btn" onclick="dj($(this))" style="cursor:pointer;" attrurl="'+ id +'">查看</button>\n' +
                                        '                    <button type="button" class="layui-btn" onclick="downFile('+aid+')" style="cursor:pointer; margin-left: 10px;" >下载</button>\n' +
                                        '                    <button type="button" class="layui-btn" id="del" onclick="delFn('+i+')" style="cursor:pointer; margin-left: 10px;"  nu = "'+ i +'">删除</button>\n' +
                                        '                </td>\n' +
                                        '            </tr>'
                                }
                            }
                            $("#tr1").after(str)
                            $(".fromTdme1").attr("rowspan",id1.length);
                        }
                        if(id2 != undefined&&id2 != ""){
                            if(id2.substring(id2.length-1,id2.length)==","){
                                id2 = id2.substring(0,id2.length-1);
                            }
                            id2 = id2.split(",");
                            name2 = name2.split(",")
                            time2 = time2.split(",")
                            var str="";
                            for(var i = 0 ; i < id2.length ; i++){
                                num = i;
                                var na = name2[i].substring(0,name2[i].length-1);
                                var id = id2[i].substring(0,id2[i].length-1);
                                var ti = time2[i];
                                var aid = "\'"+urlTOattid(id2[i].substring(0,id2[i].length-1))+"\'";
                                if(i==0){
                                    str =  ' <tr class="fromTrme3">\n' +
                                        '<td class="fromTdme22">发展对象考察培养进度</td>'+
                                        '                <td class="fromTdme2"  colspan="3">\n' +
                                        '                    <span class="mindReport">'+ na +'</span><span class="mindTime">'+ ti +'</span>' +
                                        '                    <button type="button" class="layui-btn" onclick="dj($(this))" style="cursor:pointer;" attrurl="'+ id +'">查看</button>\n' +
                                        '                    <button type="button" class="layui-btn" onclick="downFile('+aid+')" style="cursor:pointer; margin-left: 10px;" >下载</button>\n' +
                                        '                    <button type="button" class="layui-btn" id="del" onclick="delFn('+i+')" style="cursor:pointer; margin-left: 10px;"  nu = "'+ i +'">删除</button>\n' +
                                        '                </td>\n' +
                                        '            </tr>'
                                }else{
                                    str += ' <tr class="fromTrme3">\n' +
                                        '<td style="display: none"></td>'+
                                        '                <td class="fromTdme2"  colspan="3">\n' +
                                        '                    <span class="mindReport">'+ na +'</span><span class="mindTime">'+ ti +'</span>' +
                                        '                    <button type="button" class="layui-btn" onclick="dj($(this))" style="cursor:pointer;" attrurl="'+ id +'">查看</button>\n' +
                                        '                    <button type="button" class="layui-btn" onclick="downFile('+aid+')" style="cursor:pointer; margin-left: 10px;" >下载</button>\n' +
                                        '                    <button type="button" class="layui-btn" id="del" onclick="delFn('+i+')" style="cursor:pointer; margin-left: 10px;"  nu = "'+ i +'">删除</button>\n' +
                                        '                </td>\n' +
                                        '            </tr>'
                                }
                            }
                            $("#tr2").after(str)
                            $(".fromTdme22").attr("rowspan",id2.length);
                        }
                        if(id3 != undefined&&id3 != ""){
                            if(id3.substring(id3.length-1,id3.length)==","){
                                id3 = id3.substring(0,id3.length-1);
                            }
                            id3 = id3.split(",");
                            name3 = name3.split(",")
                            time3 = time3.split(",")
                            var str="";
                            for(var i = 0 ; i < id3.length ; i++){
                                num = i;
                                var na = name3[i].substring(0,name3[i].length-1);
                                var id = id3[i].substring(0,id3[i].length-1);
                                var ti = time3[i];
                                var aid = "\'"+urlTOattid(id3[i].substring(0,id3[i].length-1))+"\'";
                                if(i==0){
                                    str =  ' <tr class="fromTrme3">\n' +
                                        '<td class="fromTdme3">预备党员考察培养进度</td>'+
                                        '                <td class="fromTdme2"  colspan="3">' +
                                        '                    <span class="mindReport">'+ na +'</span><span class="mindTime">'+ ti +'</span>' +
                                        '                    <button type="button" class="layui-btn" onclick="dj($(this))" style="cursor:pointer;" attrurl="'+ id +'">查看</button>\n' +
                                        '                    <button type="button" class="layui-btn" onclick="downFile('+aid+')" style="cursor:pointer; margin-left: 10px;" >下载</button>\n' +
                                        '                    <button type="button" class="layui-btn" id="del" onclick="delFn('+i+')" style="cursor:pointer; margin-left: 10px;"  nu = "'+ i +'">删除</button>\n' +
                                        '                </td>\n' +
                                        '            </tr>'
                                }else{
                                    str += ' <tr class="fromTrme3">\n' +
                                        '<td style="display: none"></td>'+
                                        '                <td class="fromTdme2"  colspan="3">\n' +
                                        '                    <span class="mindReport">'+ na +'</span><span class="mindTime">'+ ti +'</span>' +
                                        '                    <button type="button" class="layui-btn" onclick="dj($(this))" style="cursor:pointer;" attrurl="'+ id +'">查看</button>\n' +
                                        '                    <button type="button" class="layui-btn" onclick="downFile('+aid+')" style="cursor:pointer; margin-left: 10px;" >下载</button>\n' +
                                        '                    <button type="button" class="layui-btn" id="del" onclick="delFn('+i+')" style="cursor:pointer; margin-left: 10px;"  nu = "'+ i +'">删除</button>\n' +
                                        '                </td>\n' +
                                        '            </tr>'
                                }
                            }
                            $("#tr3").after(str)
                            $(".fromTdme3").attr("rowspan",id3.length);
                        }
                    }
                })
            }
        })


        //添加思想汇报操作
        $("#add").click(function(){
            $.ajax({
                type: 'post',
                url: '/partyMember/fourReport',
                dataType: 'json',
                success: function (res) {
                    if(res.flag == true){
                        $.popWindow('/workflow/work/workform?opflag=1&flowId='+res.object.flowId+'&type=new&flowStep=1&prcsId=1&runId='+res.object.runId);
                    }else{
                        layui.layer.msg(res.msg);
                    }
                }
            })
            // if($("#add").attr("data-type") == "0"){
            //     var ftrlen = $(".fromTrme");
            //     if(ftrlen.length == 1){
            //         var str = '<tr class="fromTrme">\n' +
            //             '<td class="fromTdme1">入党积极分子思想汇报进度</td>'+
            //             '                <td class="fromTdme2"  colspan="3">\n' +
            //             '                    <span class="mindReport">上传文件</span>\n' +
            //             '                    <button type="button" id="upd" class="layui-btn"><i class="layui-icon"></i>上传文件</button>\n' +
            //             '                </td>\n' +
            //             '            </tr>'
            //     }else{
            //         var str = '<tr class="fromTrme">\n' +
            //             '<td style="display: none"></td>'+
            //             '                <td class="fromTdme2"  colspan="3">\n' +
            //             '                    <span class="mindReport">上传文件</span>\n' +
            //             '                    <button type="button" id="upd" class="layui-btn"><i class="layui-icon"></i>上传文件</button>\n' +
            //             '                </td>\n' +
            //             '            </tr>'
            //     }
            //     $(".fromTdme1").attr("rowspan",ftrlen.length);
            //     $(".fromTrme").eq(ftrlen.length-1).after(str);
            //     $("#add").attr("data-type","1")
            // }else{
            //     layer.msg("请先上传附件再继续添加");
            //     return false;
            // }
            //
            // //附件上传
            // upload.render({
            //     elem: '#upd'
            //     ,url: '/upload?module=workflow'
            //     ,accept:'file'
            //     ,done: function(res, index, upload){
            //         var data = res.obj
            //         var attUrl = data[0].attUrl;
            //         $.ajax({
            //             type: 'post',
            //             url: '/partyMember/updateTR',
            //             dataType: 'json',
            //             data:{
            //                 url:attUrl,
            //                 type:0,
            //             },
            //             success: function (res) {
            //                 layer.msg('上传成功');
            //                 window.location.reload()
            //                 $("#add").attr("data-type","0")
            //             }
            //         })
            //     }
            // });
        })
        $("#add1").click(function(){
            $.ajax({
                type: 'post',
                url: '/partyMember/fourReport',
                dataType: 'json',
                success: function (res) {
                    if(res.flag == true){
                        $.popWindow('/workflow/work/workform?opflag=1&flowId='+res.object.flowId+'&type=new&flowStep=1&prcsId=1&runId='+res.object.runId);
                    }else{
                        layui.layer.msg(res.msg);
                    }
                }
            })
        })
        $("#add2").click(function(){
            $.ajax({
                type: 'post',
                url: '/partyMember/fourReport',
                dataType: 'json',
                success: function (res) {
                    if(res.flag == true){
                        $.popWindow('/workflow/work/workform?opflag=1&flowId='+res.object.flowId+'&type=new&flowStep=1&prcsId=1&runId='+res.object.runId);
                    }else{
                        layui.layer.msg(res.msg);
                    }
                }
            })
            // if($("#add2").attr("data-type") == "0") {
            //     var ftrlen = $(".fromTrme3");
            //     if (ftrlen.length == 1) {
            //         var str = '<tr class="fromTrme3">\n' +
            //             '<td class="fromTdme3">预备党员考察培养进度</td>' +
            //             '                <td class="fromTdme2"  colspan="3">\n' +
            //             '                    <span class="mindReport">上传文件</span>\n' +
            //             '                    <button type="button" id="upd1"+ class="layui-btn"><i class="layui-icon"></i>上传文件</button>\n' +
            //             '                </td>\n' +
            //             '            </tr>'
            //     } else {
            //         var str = '<tr class="fromTrme3">\n' +
            //             '<td style="display: none"></td>' +
            //             '                <td class="fromTdme2"  colspan="3">\n' +
            //             '                    <span class="mindReport">上传文件</span>\n' +
            //             '                    <button type="button" id="upd1" class="layui-btn"><i class="layui-icon"></i>上传文件</button>\n' +
            //             '                </td>\n' +
            //             '            </tr>'
            //     }
            //     $(".fromTdme3").attr("rowspan", ftrlen.length);
            //     $(".fromTrme3").eq(ftrlen.length - 1).after(str);
            //     $("#add2").attr("data-type", "1")
            // }else {
            //     layer.msg("请先上传附件再继续添加");
            //     return false;
            // }
            // //附件上传
            // upload.render({
            //     elem: '#upd1'
            //     ,url: '/upload?module=workflow'
            //     ,accept:'file'
            //     ,done: function(res, index, upload){
            //         var data = res.obj
            //         var attUrl = data[0].attUrl;
            //         $.ajax({
            //             type: 'post',
            //             url: '/partyMember/updateTR',
            //             dataType: 'json',
            //             data:{
            //                 url:attUrl,
            //                 type:0,
            //             },
            //             success: function (res) {
            //                 layer.msg('上传成功');
            //                 window.location.reload()
            //                 $("#add2").attr("data-type","0")
            //             }
            //         })
            //     }
            // });
        })

    })

    function urlTOattid(url){
        var atts = url.split("&");
        var aid = "";
        var ym = "";
        var attid = "";
        for(var i = 0; i<atts.length;i++){
            if(atts[i].indexOf("AID=") > -1){
                aid=atts[i].split("=")[1]
            }else if(atts[i].indexOf("YM=")> -1){
                ym=atts[i].split("=")[1]
            }else if(atts[i].indexOf("ATTACHMENT_ID=")> -1){
                attid=atts[i].split("=")[1]
            }
        }
        return aid+"@"+ym+"_"+attid;
    }
    // 查阅操作
    function dj(e){
        var atturl = e.attr('attrurl');
        pdurl(UrlGetRequest('?'+atturl),atturl);
    }
    function pdurl(gs,atturl){ //根据后缀判断选择调取那种打开方式
        if(atturl != undefined&&atturl.indexOf('&ATTACHMENT_NAME=') > -1&&atturl.indexOf('isOld=1') == -1){
            var atturl1 = atturl.split('&ATTACHMENT_NAME=')[0] + '&ATTACHMENT_NAME=';
            var atturl2 = '';
            if(atturl.split('&ATTACHMENT_NAME=')[1] != undefined&&atturl.split('&ATTACHMENT_NAME=')[1].indexOf('&') > -1){
                for(var i=1;i<atturl.split('&ATTACHMENT_NAME=')[1].split('&').length;i++){
                    atturl2 += '&' + atturl.split('&ATTACHMENT_NAME=')[1].split('&')[i];
                }
                atturl = atturl1 + atturl2;
            }else{
                atturl = atturl1;
            }
        }
        if(gs == 'png'||gs == 'jpg'||gs == 'bmp' || gs == 'emf' || gs == 'gif'|| gs == 'pcx'|| gs == 'pcd'|| gs == 'ai'|| gs == 'webp'|| gs == 'WMF'|| gs == 'dxf' ||gs == 'PNG'||gs == 'JPG'||gs == 'BMP' || gs == 'EMF' || gs == 'GIF'|| gs == 'PCX'|| gs == 'PCD'|| gs == 'AI'|| gs == 'WEBP'|| gs == 'wmf'|| gs == 'DXF'|| gs == 'txt'|| gs == 'TXT'){
            $.popWindow("/xs?"+atturl,PreviewPage,'0','0','1200px','600px');
        }else if(gs == 'mp4'||gs == 'rmvb'||gs == 'avi'||gs == 'ifo'||gs == 'wmv'||gs == 'MP4'||gs == 'RMVB'||gs == 'AVI'||gs == 'IFO'||gs == 'WMV'){
            layer.open({type: 2, title: false, area: ['630px', '360px'], shade: 0.8, closeBtn: 0, shadeClose: true, content: "/common/video?videoatturlsplit="+atturl});
            layer.msg('点击任意处关闭');
        }else if(gs == 'pdf'||gs == 'PDF'){
            $.popWindow("/pdfPreview?"+atturl,PreviewPage,'0','0','1200px','600px');
        }else{
            var url = "/common/webOfficeView?documentEditPriv=0&fomat="+gs+"&"+atturl;
            $.ajax({
                url:'/syspara/selectTheSysPara?paraName=OFFICE_EDIT',
                type:'post',
                datatype:'json',
                async:false,
                success: function (res) {
                    if(res.flag){
                        if(res.object[0].paraValue == 0){
                            //默认加载NTKO插件 进行跳转
                            url = "/common/ntkoview?documentEditPriv=0&fomat="+gs+"&"+atturl;
                        }
                    }

                }
            })
            $.popWindow(url,PreviewPage,'0','0','1200px','600px');
        }
    }
    // 下载操作
    function downFile(repalogId){
        if (repalogId == undefined || repalogId == "") {
            layer.msg("文件已被损坏，无法下载");
        } else {
            window.location.href = "/equipment/limsDownload?model=workflow&attachId=" +repalogId
        }
    }
    // 删除操作
    function delFn(e) {
        $.ajax({
            type: 'post',
            url: '/partyMember/updateTR',
            dataType: 'json',
            data:{
                type:1,
                n:e
            },
            success: function (res) {
                layer.msg('删除成功');
                window.location.reload()
            }
        })
    }
    function runWorkListPage() {
        location.reload();
    }
</script>

